/**
 * @Title: ProjectAttach.java 
 * @Description: TODO
 * @author <a href="mailto:psammead@126.com">Psammead</a>
 * @date 2011-7-16 上午10:04:16 
 * @version 1.0
 * Copyright 2011 by Psammead
 */
package com.psammead.dms.project.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.psammead.dms.common.core.bo.AbstractBaseBO;

/**
 * @ClassName: ProjectAttach
 * @Description: TODO
 * @author <a href="mailto:psammead@126.com">psammead</a>
 * @version 1.0
 * @date 2011-7-16
 */
@Entity(name="ProjectAttach")
@Table(name="tb_pm_attach")
public class ProjectAttach extends AbstractBaseBO implements Serializable {
	
	/**
	 * @Fields serialVersionUID : TODO
	 */
	private static final long serialVersionUID = -3373245625422548849L;
	private long id;
	private Project project;
	private Issue issue;
	private String name;
	private String fileType;
	private String filePath;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="attach_id")
	@Override
	public long getId() {
		// TODO Auto-generated method stub
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	@Column(name="name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name="file_type")
	public String getFileType() {
		return fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}

	@Column(name="file_path")
	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	@ManyToOne(fetch=FetchType.LAZY, cascade={CascadeType.MERGE,
			CascadeType.REFRESH},optional=true)
	@JoinColumn(name="project_id")
	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	@ManyToOne(fetch=FetchType.LAZY, cascade={CascadeType.MERGE,
			CascadeType.REFRESH},optional=true)
	@JoinColumn(name="issue_id")
	public Issue getIssue() {
		return issue;
	}

	public void setIssue(Issue issue) {
		this.issue = issue;
	}

}
